package com.openbravo.pos.reports;

import com.openbravo.basic.BasicException;
import com.openbravo.data.gui.ComboBoxValModel;
import com.openbravo.data.loader.Datas;
import com.openbravo.data.loader.QBFCompareEnum;
import com.openbravo.data.loader.SerializerWrite;
import com.openbravo.data.loader.SerializerWriteBasic;
import com.openbravo.pos.forms.AppLocal;
import com.openbravo.pos.forms.AppView;
import com.openbravo.pos.inventory.MovementReason;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class JParamsReason extends JPanel
  implements ReportEditorCreator
{
  private ComboBoxValModel m_ReasonModel;
  private JLabel jLabel2;
  private JComboBox m_jreason;

  public JParamsReason()
  {
    initComponents();
    this.m_ReasonModel = new ComboBoxValModel();
    this.m_ReasonModel.add(null);
    this.m_ReasonModel.add(MovementReason.IN_PURCHASE);
    this.m_ReasonModel.add(MovementReason.IN_REFUND);
    this.m_ReasonModel.add(MovementReason.IN_MOVEMENT);
    this.m_ReasonModel.add(MovementReason.OUT_SALE);
    this.m_ReasonModel.add(MovementReason.OUT_REFUND);
    this.m_ReasonModel.add(MovementReason.OUT_BREAK);
    this.m_ReasonModel.add(MovementReason.OUT_MOVEMENT);
    this.m_jreason.setModel(this.m_ReasonModel);
  }

  public void init(AppView paramAppView)
  {
  }

  public void activate()
    throws BasicException
  {
  }

  public SerializerWrite getSerializerWrite()
  {
    return new SerializerWriteBasic(new Datas[] { Datas.OBJECT, Datas.INT });
  }

  public Component getComponent()
  {
    return this;
  }

  public Object createValue()
    throws BasicException
  {
    return new Object[] { this.m_ReasonModel.getSelectedItem() == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_EQUALS, this.m_ReasonModel.getSelectedKey() };
  }

  private void initComponents()
  {
    this.jLabel2 = new JLabel();
    this.m_jreason = new JComboBox();
    setLayout(null);
    setBorder(BorderFactory.createTitledBorder(AppLocal.getIntString("label.byreason")));
    setPreferredSize(new Dimension(400, 60));
    this.jLabel2.setText(AppLocal.getIntString("label.stockreason"));
    add(this.jLabel2);
    this.jLabel2.setBounds(20, 20, 100, 14);
    add(this.m_jreason);
    this.m_jreason.setBounds(150, 20, 220, 20);
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.reports.JParamsReason
 * JD-Core Version:    0.6.0
 */